import CryptoJS from "crypto-js";
// 系统区分

export function generateFingerprint(){
    let coreNum=navigator.hardwareConcurrency?navigator.hardwareConcurrency:"IE";
    let totalMemory = navigator.deviceMemory?navigator.deviceMemory:"IE";
    let fingerprint = [
        coreNum,
        totalMemory,
        navigator.userAgent,
        [screen.height,screen.width, screen.colorDepth].join("x"),
        new Date().getTimezoneOffset(),
        // 其他收集到的信息
    ].join(";");
    const physicalId = CryptoJS.SHA256(fingerprint).toString()
    return physicalId; // 使用sha256哈希处理一下
}

